Repository navigation
feat(app-inspector): explain IAM denials and suggest fixes; recommend them over the IAM policy analyzer - #140
Draft
joe4dev wants to merge 1 commit into
Conversation
1 of 3 tasks
joe4dev
force-pushed
the
devx-1089-update-the-app-inspector-mcp-tool-with-iam
branch
from
November 23, 2026 15:18
756ad8d to
f6aae77
Compare
joe4dev
force-pushed
the
devx-1089-update-the-app-inspector-mcp-tool-with-iam
branch
from
November 23, 2026 15:19
f6aae77 to
bf23440
Compare
… them over the IAM policy analyzer
localstack-app-inspector gets task-shaped IAM actions that return what the App Inspector UI shows:
- list-iam-denials: one row per denied request, paginated, with the enforcement and the suggestion's outcome.
- explain-iam: the deciding policies and matched statements, LocalStack's suggested fix (suggestion v1:
outcome, entries, near misses, hints) in the order the UI's agent prompt uses, then the payload as sent.
- get-iam-policy: a truncated policy's full documents.
- get-auto-derived-iam-policies / reset-auto-derived-iam-policies: least-privilege policies LocalStack derives
from the requests it saw since the last reset.
- get-iam-mode / set-iam-mode: the enforcement mode through /_aws/iam/config.
The responses render only what the backend sends (no client-side IAM decisions) and escape payload text so it
can't break the markdown. The server instructions point agents to list-iam-denials before they change a policy
or conclude that another account must change one.
localstack-iam-policy-analyzer is not deprecated (a pending product decision): it works unchanged, and its
description and every response recommend the app-inspector action for the same job.
AGENTS.md documents the IAM actions ("Features"), their LocalStack gaps and the open deprecation decision;
REVIEW.md §6 gets the IAM checks. CI's tool tests and the MCP evals run the nightly image, which has the IAM
event details.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
joe4dev
force-pushed
the
devx-1089-iam-actions
branch
from
November 23, 2026 15:19
29d22cf to
0c43817
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
DEVX-1089:
localstack-app-inspectorshould give an agent the same IAM data the App Inspector UI shows: the policies that decided a request, LocalStack's suggested fix, and least-privilege policies derived from a run. It should return them in a form an agent can act on without scraping free text. Until now, IAM went throughlocalstack-iam-policy-analyzer, which parses container logs and synthesizes policies in the client, against the design rules in #136.Stacked on #136 (design rules), whose "IAM policies" section this implements.
Solution
New actions on
localstack-app-inspector:list-iam-denialsexplain-iamget-iam-policyget-auto-derived-iam-policies/reset-auto-derived-iam-policiesget-iam-mode/set-iam-mode/_aws/iam/configxmcp.config.ts) point agents tolist-iam-denialsbefore they change a policy, or conclude another account must change one.localstack-iam-policy-analyzerstays, and recommends App Inspector. Whether to deprecate it is a pending product decision, recorded under "Open questions" in AGENTS.md. Until then it works unchanged; its description and every response recommend thelocalstack-app-inspectoraction for the same job, without saying it is deprecated.localstack/localstack-pro:dev, which has the IAM event details before a release does.iam-troubleshootingprompt. AGENTS.md gets the IAM design ("Features → IAM policies"), which moved here from docs: add agent design rules and review checks (AGENTS.md, REVIEW.md) #136 and now describes what is built, plus its LocalStack gaps, the analyzer's deviation and the open deprecation decision. REVIEW.md §6 gets the IAM review checks.New LocalStack APIs (maintainer approval needed)
Per AGENTS.md, adopting these needs a maintainer's approval recorded here:
GET /_localstack/appinspector/v1/events/{event_id}/policies/{policy_key}(get-iam-policy)GET/DELETE /_aws/iam/policies/summary(get-auto-derived-iam-policies,reset-auto-derived-iam-policies)Agentic evaluation
The end-to-end eval is in the follow-up PR (#141). Claude Code (Sonnet 5.5) fixed small CloudFormation projects with and without this server; both arms had the AWS CLI and LocalStack's log. There were 3 runs per scenario, on the Claude subscription and on OpenRouter.
For the deprecation decision
A second run (Claude subscription, 3 runs per scenario) compared the analyzer with App Inspector:
Testing
yarn test: 601/601.yarn buildpasses.tests/mcp/direct.spec.mjsandtools.spec.mjscover the new actions against a real LocalStack in CI.Review
Advise review: this adds a user-facing IAM workflow, steers agents away from an existing tool, and adopts two LocalStack APIs.
🤖 Generated with Claude Code